package com.happy.controller.admin;


import com.happy.base.redis.RedisService;
import com.happy.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.RedisServer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller("AdminTestController")
@RequestMapping("/admin/test")
public class TestController {

    @Autowired
    private RedisUtils redisUtil;

    @ResponseBody
    @RequestMapping("/test")
    public String test() {
        redisUtil.set("User:2", "this is test", 300L);
        return "hello";
    }


    @ResponseBody
    @RequestMapping("/test1")
    public String test1() {
        String string = redisUtil.get("User:2").toString();
        return string;
    }




}
